<template>
  <div  style="display: inline; text-align: center; vertical-align: middle;">
    <form id="searchBox">
        <el-input 
            type="text"
            placeholder="搜索路线"
            v-model="input2">
            <a slot="prefix" class="el-input__icon el-icon-search" @click="submitResult"></a>
        </el-input>
    </form>
  </div>
</template>

<script>
export default {
    data(){
        return {
            input2:'',
            msg:'2'
        }
    },
    methods:{
        submitResult(){
            var formData = new FormData(document.getElementById('searchBox'));
            formData.append('content',this.input2);
            console.log(formData.get("content"));
            this.$bus.$emit('inputData', this.input2);
        }
    },
}
</script>

<style>
    .el-input{
        width: 400px;
    }
</style>